home *** CD-ROM | disk | FTP | other *** search
- package Local.Game.Thing
- {
- import Local.Audio.CAudio;
- import Local.CGlobal;
- import Local.Game.CGame;
- import Local.Game.Level.CLevel;
- import Local.Game.World.CLandscape;
- import Local.Game.World.CWorld;
- import Local.Game.World.Map.CMap;
- import flash.events.Event;
- import flash.events.EventDispatcher;
-
- public class CThingBase extends EventDispatcher
- {
-
- private static var _Game:CGame;
-
- private static var _Landscape:CLandscape;
-
- public static const DISPOSED:String = "DISPOSED";
-
- public static var mAllocateID:int = 5;
-
- public static var mEnemySpeed:Number = 1;
-
- public static const DEATH:String = "DEATH";
-
- private static var _World:CWorld;
-
- public static var mGameTick:int = 0;
-
- private static var _Map:CMap;
-
- public static const SECONDS:int = 25;
-
- {
- if(true)
- {
- DISPOSED = "DISPOSED";
- if(true)
- {
- DEATH = "DEATH";
- if(true)
- {
- mAllocateID = 5;
- SECONDS = 25;
- }
- mGameTick = 0;
- }
- mEnemySpeed = 1;
- }
- }
-
- public var nID:int;
-
- public var _Life:int;
-
- public var mName:String;
-
- public var OnDispose:Function;
-
- public var mSelectable:Boolean;
-
- public var mScore:int;
-
- public var mDisposed:Boolean;
-
- public var OnDeath:Function;
-
- public var mBaseType:String;
-
- public var mKilledBy:*;
-
- public var mType:String;
-
- public var mID:String;
-
- public var mMaxLife:int;
-
- public var Process:Function;
-
- public var nProcessID:int;
-
- public function CThingBase()
- {
- super();
- nID = ++mAllocateID;
- mID = "T" + nID;
- }
-
- public static function set mGame(param1:CGame) : void
- {
- if(true)
- {
- _Game = param1;
- if(true)
- {
- _World = _Game.mWorld;
- _Map = _World.mMap;
- }
- _Landscape = _World.mLandscape;
- }
- }
-
- public static function Restart() : void
- {
- mAllocateID = 0;
- }
-
- public function get mLevel() : CLevel
- {
- return _World.mLevel;
- }
-
- public function set mLife(param1:int) : void
- {
- §§push(param1);
- §§push(0);
- if(true)
- {
- if(§§pop() <= §§pop() && _Life > 0)
- {
- dispatchEvent(new Event(DEATH));
- }
- _Life = param1;
- return;
- }
- §§goto(addr26);
- }
-
- public function get mGame() : CGame
- {
- return _Game;
- }
-
- public function get mWorld() : CWorld
- {
- return _World;
- }
-
- public function get mExists() : Boolean
- {
- return !(mDead || mDisposed);
- }
-
- public function get mLife() : int
- {
- return _Life;
- }
-
- public function get mMap() : CMap
- {
- return _Map;
- }
-
- public function get mLandscape() : CLandscape
- {
- return _Landscape;
- }
-
- public function IncrementKill() : uint
- {
- return CGlobal.IncrementStat("kill_" + mType);
- }
-
- public function IncrementBuild() : uint
- {
- return CGlobal.IncrementStat("build_" + mType);
- }
-
- public function set mDead(param1:Boolean) : void
- {
- if(true)
- {
- if(param1)
- {
- mLife = 0;
- }
- }
- }
-
- public function IncrementDeath() : uint
- {
- return CGlobal.IncrementStat("death_" + mType);
- }
-
- public function IncrementFired() : uint
- {
- return CGlobal.IncrementStat("fired_" + mType);
- }
-
- public function get mAudio() : CAudio
- {
- return _Game.mAudio;
- }
-
- public function get mDead() : Boolean
- {
- return _Life <= 0;
- }
-
- public function IncrementReachedObjective() : uint
- {
- return CGlobal.IncrementStat("robj_" + mType);
- }
-
- public function Dispose() : void
- {
- if(true)
- {
- if(!mDisposed)
- {
- if(true)
- {
- mDisposed = true;
- mLife = 0;
- }
- dispatchEvent(new Event(DISPOSED));
- }
- }
- }
- }
- }
-